<template>
  <div class="app-container calendar-list-container">
    <div class="apply-query">
      <el-row class="filter-query">
        <el-col><span>{{$t('peopleManager.queryCriteria')}}</span></el-col>
      </el-row>
      <el-form :inline="true" :model="listQuery" style="padding: 0 20px">
        <el-row>
          <el-col :span="4">
            <div class="w20">
              <div class="labelName">{{$t('peopleManager.username')}}</div>
              <el-input v-model="listQuery.username" :placeholder="$t('peopleManager.enterUsername')" clearable class="filter-item"></el-input><!--请输入员编-->
            </div>
          </el-col>
          <el-col :span="4">
            <div class="w20">
              <div class="labelName">{{$t('peopleManager.name')}}</div>
              <el-input v-model="listQuery.name" :placeholder="$t('peopleManager.enterName')" clearable class="filter-item"></el-input>
            </div>
          </el-col>
          <el-col :span="4">
            <div class="w20">
              <div class="labelName">{{$t('peopleManager.bu')}}</div>
              <el-select clearable collapse-tags multiple v-model="listQuery.bu" :placeholder="$t('placeholder.choose')">
                <el-option v-for="item in buList" :key="item" :label="item" :value="item"></el-option>
              </el-select>
            </div>
          </el-col>
          <el-col :span="4">
            <div class="w20">
              <div class="labelName">{{$t('peopleManager.groupType')}}</div>
              <el-select clearable multiple  collapse-tags v-model="listQuery.groupType" :placeholder="$t('placeholder.choose')">
                <el-option v-for="item in typeOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </div>
          </el-col>
          <el-col :span="4">
            <div class="w20">
              <div class="labelName">{{$t('peopleManager.costCenter')}}</div>
              <yt-select :allList="true" :multiple="true" v-model="listQuery.costCenter" :listData="this.$store.getters.allDic.costCenter"></yt-select>
            </div>
          </el-col>
          <el-col :span="4">
            <div class="w20">
              <div class="labelName">{{$t('peopleManager.status')}}</div>
              <dict-select v-model="listQuery.status" code="whetherEffective" :allList="true" :clearable="true"></dict-select>
            </div>
          </el-col>
          <el-col style="margin-top: 20px;text-align: center;">
            <div class="yt-btn yt-btn-ys" type="primary" @click="handleFilter">{{config.search}}</div>
            <div class="yt-btn yt-ml8" type="primary" @click="reset"> {{config.reset}}</div>
          </el-col>
        </el-row>
      </el-form>

    </div>
    <div class="yt-data-list">
      <div class="yt-list-title">
        <span>{{$t('peopleManager.personnelList.list')}}</span>
      </div>
      <div class="yt-list-content">
        <div class="list-operation">
            <!--新增-->
            <el-button type="primary" class="yt-btn-ys" @click="dictDialogVisible = true">{{ $t("button.new") }}</el-button>
            <div class="yt-btn yt-btn-ys" type="primary"  @click="handlePreserve('edit')">{{$t('button.preserve')}}</div>
             <!--导出-->
           <el-button  class="yt-btn-ys" type="primary" @click="handleRemit">{{$t('button.export')}}</el-button >
        </div>
        <el-table class="yt-table yt-temporary" :key='tableKey' :data="list" :empty-text="$t('placeholder.emptyText')" v-loading.body="listLoading" border fit highlight-current-row max-height="600"  @sort-change="sortDate">
          <el-table-column class-name="bg" align="center" type="index" :label="$t('peopleManager.personnelList.index')" width="60" fixed/>
          <el-table-column class-name="bg" align="center" :label="$t('peopleManager.personnelList.username')" min-width="100" prop="username" sortable="custom" fixed/>
          <el-table-column class-name="bg" align="center" :label="$t('peopleManager.personnelList.name')" min-width="100" prop="name" sortable="custom" fixed/>
          <el-table-column align="center" :label="$t('peopleManager.personnelList.ename')" min-width="180" sortable="custom">
            <template slot-scope="scope">
              <el-input size="small" v-model="scope.row.ename"></el-input>
            </template>
          </el-table-column>
          <!-- 部门编号 -->
          <el-table-column  align="center" :label="$t('peopleManager.personnelList.erpBuNo')" min-width="100"  sortable="custom">
             <template slot-scope="scope">
              <el-input size="small" v-model="scope.row.erpBuNo"></el-input>
            </template>
         </el-table-column>
           <!-- 部门名称 -->
          <el-table-column  align="center" :label="$t('peopleManager.personnelList.erpBuName')" min-width="100"  sortable="custom">
           <template slot-scope="scope">
              <el-input size="small" v-model="scope.row.erpBuName"></el-input>
            </template>
          </el-table-column>

          <el-table-column align="center" label="Account" min-width="180" sortable>
            <template slot-scope="scope">
              <el-select filterable clearable  @change="((val)=>{setBg(val, scope.row)})"  v-model="scope.row.bu" :placeholder="$t('placeholder.choose')">
                <el-option v-for="(item, index) in buAndBgList" :key="index" :label="item.bu" :value="item.bu"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column class-name="bg" align="center" label="Category" min-width="100" prop="bg" sortable="custom"/>
          <el-table-column class-name="bg" align="center" :label="$t('peopleManager.personnelList.costCenterHrm')" min-width="160" prop="costCenterHrm" sortable="custom"/>
          <el-table-column align="center" :label="$t('peopleManager.personnelList.costCenter')" min-width="150">
            <template slot-scope="scope">
                <template>
                  <dict-select v-model="scope.row.costCenter" code="costCenter" :clearable="true"></dict-select>
                </template>
            </template>
          </el-table-column>

          <el-table-column align="center" :label="$t('peopleManager.personnelList.dataPermissions')" min-width="150">
            <template slot-scope="scope">
              <el-select v-model="scope.row.dataPermissionss" multiple collapse-tags :placeholder="$t('placeholder.choose')">
                <el-option v-for="item in dataPermissionsList" :key="item.value" :label="item.value" :value="item.value"></el-option>
              </el-select>
            </template>
          </el-table-column>

          <el-table-column align="center" :label="$t('peopleManager.personnelList.groupTypes')" min-width="200"  sortable="custom">
            <template slot-scope="scope">
              <el-select v-model="scope.row.groupTypes" multiple collapse-tags :placeholder="$t('tips.pleaseChoose')">
                <el-option v-for="item in typeOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </template>
          </el-table-column>
          <!--直属主管 -->
          <el-table-column  align="center" :label="$t('peopleManager.personnelList.directManager')" min-width="150" sortable="custom">
            <template slot-scope="scope">
                <popover-select selectType="user" @input="select" v-model="scope.row.directManager"  :placeholder="$t('placeholder.searchKeywords')">
                </popover-select>
            </template>
          </el-table-column>

          <!--上级主管 -->
          <el-table-column  align="center" :label="$t('peopleManager.personnelList.superiors')" min-width="150" sortable="custom">
            <template slot-scope="scope">
                <popover-select selectType="user" @input="select" v-model="scope.row.superiors"  :placeholder="$t('placeholder.searchKeywords')">
                </popover-select>
            </template>
          </el-table-column>

          <el-table-column align="center" :label="$t('peopleManager.personnelList.cc')" sortable="custom" prop="cc" min-width="300px">
            <template slot-scope="scope">
              <el-input type="textarea" autosize size="small" v-model="scope.row.cc"></el-input>
            </template>
          </el-table-column>
          <el-table-column align="center" :label="$t('peopleManager.personnelList.mobilePhone')" min-width="180" sortable="custom">
            <template slot-scope="scope">
              <el-input size="small" v-model="scope.row.mobilePhone"></el-input>
            </template>
          </el-table-column>
          <el-table-column align="center" :label="$t('peopleManager.personnelList.email')" min-width="180" sortable="custom" prop="email">
            <template slot-scope="scope">
              <el-input size="small" v-model="scope.row.email"></el-input>
            </template>
          </el-table-column>

            <el-table-column align="center" :label="$t('peopleManager.personnelList.status')" min-width="100">
            <template slot-scope="scope">
                <template>
                  <dict-select v-model="scope.row.status" code="whetherEffective" :clearable="true"></dict-select>
                </template>
            </template>
          </el-table-column>  
 
          <el-table-column class-name="bg" align="center" label="最後更改密碼" prop="resetTime" min-width="140" />
          <el-table-column class-name="bg" align="center" label="最后登录时间" prop="lastedLoginTime" min-width="140" />
        </el-table>
        <div class="pagination-container">
          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background :current-page.sync="listQuery.page" :page-sizes="[10, 20, 30, 50, 100, 200]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
        </div>
      </div>
    </div>



<el-dialog :title="$t('bu.newData')" :visible.sync="dictDialogVisible" :close-on-click-modal="false" class="yt-dialogForm-box">
      <el-form ref="form" :model="addData" :inline="true" label-width="100px" class="yt-dialogForm">
        <!--员编 -->
        <el-form-item :label="$t('peopleManager.username')">
          <template>
           <el-input  type="text" size="small" v-model="addData.username" :placeholder="$t('peopleManager.enterUsername')"></el-input>
          </template>
        </el-form-item>
        <!--中文名 -->
        <el-form-item :label="$t('中文名稱')" >
          <template>
            <el-input  type="text" size="small" v-model="addData.name" :placeholder="$t('請輸入中文名稱')"></el-input>
          </template>
        </el-form-item>

         <!--英文名 -->
        <el-form-item :label="$t('peopleManager.personnelList.ename')" >
          <template>
            <el-input  type="text" size="small" v-model="addData.ename" :placeholder="$t('請輸入英文名稱')"></el-input>
          </template>
        </el-form-item>

        <!--部门编号 -->
         <el-form-item :label="$t('peopleManager.personnelList.erpBuNo')">
          <template>
            <el-input  type="text" size="small" v-model="addData.erpBuNo"></el-input>
          </template>
        </el-form-item>
        <!--部门名称 -->
         <el-form-item :label="$t('peopleManager.personnelList.erpBuName')">
          <template>
            <el-input  type="text" size="small" v-model="addData.erpBuName"></el-input>
          </template>
        </el-form-item>

        <!--Category -->
         <el-form-item label="Account">
          <template>
             <el-select clearable v-model="addData.bu" @change="changeBu1" :placeholder="$t('placeholder.choose')">
                  <el-option v-for="item in buList1" :key="item" :label="item" :value="item"></el-option>
                </el-select>
          </template>
        </el-form-item>

          <!--BU -->
        <el-form-item label="Category">
          <template>
            <el-select clearable v-model="addData.bg" @change="changeBg1" :placeholder="$t('placeholder.choose')">
                  <el-option v-for="item in bgList1" :key="item" :label="item" :value="item"></el-option>
                </el-select>
          </template>
        </el-form-item>

         <!--成本中心（HRM） -->
         <el-form-item :label="$t('peopleManager.personnelList.costCenterHrm')">
          <template>
            <el-input  type="text" size="small" v-model="addData.costCenterHrm"></el-input>
          </template>
        </el-form-item>

        <!--成本中心 -->
         <el-form-item :label="$t('peopleManager.costCenter')">
            <yt-select v-model="addData.costCenter" :listData="this.$store.getters.allDic.costCenter" clearable :placeholder="$t('placeholder.choose')"></yt-select>
        </el-form-item>
        
        <!--數據權限 -->
        <el-form-item :label="$t('peopleManager.personnelList.dataPermissions')">
          <el-select class="yt-multiple" multiple collapse-tags v-model="addData.dataPermissions"  :placeholder="$t('placeholder.choose')">
            <el-option v-for="item in dataPermissionsList" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>

         <!--系統角色 -->
        <el-form-item :label="$t('peopleManager.personnelList.groupTypes')">
          <el-select class="yt-multiple" multiple collapse-tags v-model="addData.groupType"  :placeholder="$t('placeholder.choose')">
            <el-option v-for="item in typeOptions"  :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </el-form-item>


          <!--直屬主管 -->
        <el-form-item :label="$t('peopleManager.personnelList.directManager')">
          <template>
            <popover-select selectType="user" @input="select" v-model="addData.directManager"  :placeholder="$t('placeholder.searchKeywords')"></popover-select>
          </template>
        </el-form-item>

        
          <!--上級主管 -->
        <el-form-item :label="$t('peopleManager.personnelList.superiors')">
          <template>
            <popover-select selectType="user" @input="select" v-model="addData.superiors"  :placeholder="$t('placeholder.searchKeywords')"></popover-select>
          </template>
        </el-form-item>

         <!--CC員編 -->
        <el-form-item :label="$t('peopleManager.personnelList.cc')">
          <template>
            <el-input  type="text" size="small" v-model="addData.cc"></el-input>
          </template>
        </el-form-item>

         <!--手機號碼 -->
        <el-form-item :label="$t('peopleManager.personnelList.mobilePhone')">
          <template>
            <el-input  type="text" size="small" v-model="addData.mobilePhone"></el-input>
          </template>
        </el-form-item>

           <!--郵箱 -->
        <el-form-item :label="$t('peopleManager.personnelList.email')">
          <template>
            <el-input  type="text" size="small" v-model="addData.email"></el-input>
          </template>
        </el-form-item>

        
      <!--是否有效 -->
      <el-form-item :label="$t('peopleManager.personnelList.status')" prop="status">
            <yt-select v-model="addData.status" :listData="this.$store.getters.allDic.whetherEffective" clearable :placeholder="$t('placeholder.choose')"></yt-select>
        </el-form-item>

      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dictDialogVisible = false">{{
          $t("button.cancel")
        }}</el-button>
        <el-button type="primary" @click="insertData">{{
          $t("button.determine")
        }}</el-button>
      </span>
</el-dialog>


  </div>
</template>

<script>
  import popoverSelect from '@/components/popover-select/index.vue';
  import { getUserInfoList, saveUserInfo ,inserUserInfo} from '@/api/dict/dictValue/index';
  import { selectBuAndBg, selectBu, selectBg,listbgAndbu,getUserList } from '@/api/bu/index';
  import { mapGetters } from 'vuex';
  import YtGetTemplateSelect from '@/components/Yt-template/getTemplateSelect.vue';
  import popoverSetQuery from '@/components/popover-setQuery/index.vue';
  // import { getToken } from '@/utils/auth'
  import formatter from '@/utils/formatter';

  export default {
    name: 'buInfo',
    components: {
       popoverSetQuery,
      popoverSelect,
      YtGetTemplateSelect,
      'dict-select': () => import('@/components/Dict/dictValueSelect'),
      'yt-select': () => import('@/components/Yt-select/index')
    },
    data() {
      return {
        value1: '',
        config: Config.I18n,
        formatter,
        flag: true,
        uploadHeaders: {
          Authorization: null
        },
        buAndBgList: [],
        listMapAll: this.$store.getters.allMapDic,
        buList: [],
        buList1: [],
        bgList1: [],
        select: [],
        typeOptions: [],
        isCaseOptions: [{ label: '1', value: '1' }, { label: '2', value: '2' }],
        appearanceImageList: [],
        dictDialogVisible: false,
         addData: {
          dataYear: '',
          projectCode: '',
          pastYearIncome: '',
          dataPermissions: [],
          groupType: []
          
        },
        form: {
          username: undefined,
          name: undefined,
          sex: 'comm_sex_man',
          password: undefined,
          description: undefined,
          departName: undefined,
          departId: undefined,
          groupType: undefined,
          email: undefined
        },
        groupTypeList: [
          {
            value: 'superAdmin',
            label: '超级管理员'
          },
          {
            value: 'firstParty',
            label: '甲方'
          },
          {
            value: 'projectAdmin',
            label: '项目管理员'
          }
        ],
        disabledList: [
          {
            value: '1',
            label: '有效'
          },
          {
            value: '0',
            label: '无效'
          }
        ],
        strAll: {
          status: {
            0: '无效',
            1: '有效'
          }
        },
        list: null,
        total: null,
        listLoading: true,
        dataPermissionsList: [],
        listQuery: {
          order: '', // 降序（desc）/升序（asc）
          orderBy: '', // 排序字段
          page: 1,
          limit: 10,
          username: '',
          name: '',
          bu: [],
          groupType: [],
          costCenter: [],
          status: ''
        },
        dialogFormVisible: false,
        dialogDepartVisible: false,
        dialogStatus: '',
        userManager_btn_edit: false,
        userManager_btn_del: false,
        userManager_btn_add: false,
        textMap: {
          update: '编辑',
          create: '创建'
        },
        tableKey: 0
      };
    },
    mounted() {
      this.getBu();
      this.getBuAndBg()
      this.getUserList();
      
    },
    created() {
      this.getUserList();
      // this.uploadHeaders.Authorization = getToken()
      this.getQuery();
      this.getList();
      // this.userManager_btn_edit = this.elements['userManager:btn_edit']
      // this.userManager_btn_del = this.elements['userManager:btn_del']
      // this.userManager_btn_add = this.elements['userManager:btn_add']
        this.getBu1();
        this.getBg1();
        this.getBu();
    },
    activated() {
      this.getQuery();
    },
    computed: {
      ...mapGetters(['elements'])
    },
    methods: {
      getUserList() {
        getUserList({ groupType: 'role' }).then(res => {
          this.typeOptions = res;
        });
      },
     
     // 新增
      insertData() {
        if (!this.addData.username) {
          this.$message({
            message: this.$t('peopleManager.enterUsername'),
            type: 'error'
          })
           return false;;
        }
        if (!this.addData.name) {
              this.$message({
                message: this.$t('peopleManager.enterName'),
                type: 'error'
              })
               return false;;
        }
         if (!this.addData.ename) {
              this.$message({
                message: this.$t('請輸入英文名稱'),
                type: 'error'
              })
               return false;;
        }
        if(!this.addData.bu) {
                this.$message({
                  message: this.$t('請选择Category'),
                  type: 'error'
                })
              return false;
          }

        if(this.addData.groupType.length ==0) {
          this.$message({
              message: this.$t('請选择系統角色'),
              type: 'error'
            })
             return false;
        }

        if (this.addData.dataPermissions.length ==0) {
              this.$message({
                message: this.$t('請选择數據權限'),
                type: 'error'
              })
             return false;;
        }

        if(!this.addData.status) {
                this.$message({
                  message: this.$t('請选择是否有效'),
                  type: 'error'
                })
              return false;
          }

        this.addData.groupType = this.addData.groupType.join(',')
        this.addData.dataPermissions = this.addData.dataPermissions.join(',')

        inserUserInfo(this.addData).then(res => {
          if (res.status === 200) {
            this.$notify({
              title: this.$t('tips.success'),
              message: this.$t('tips.addSuccess'),
              type: 'success',
              duration: 2000
            });
            this.dictDialogVisible = false
              this.addData = {
                dataPermissions: [],
                groupType: [],
                  bu: [],
                  bg: []
             }
            this.getList()
          } else {
            this.$notify({
              title: this.$t('bu.tips.fail'),
              message: res.message,
              type: 'warning'
            });
          }
        })
      },
      handleRemit() {
        //导出  
        const str = '?order=' +  this.listQuery.order +'&orderBy=' +  this.listQuery.orderBy +'&username=' + this.listQuery.username + '&name=' + this.listQuery.name + '&bu=' + this.listQuery.bu + '&groupType=' + this.listQuery.groupType + '&costCenter=' + this.listQuery.costCenter + '&status=' + this.listQuery.status;
        const a = document.createElement('a');
        const href = '/api/admin/excel/exportUser' + str;
        a.download = Date.now();
        a.href = href;
        a.click();
      },
      setBg(val, row) {
        if (this.buAndBgList) {
          for (let i = 0; i < this.buAndBgList.length; i++) {
            if (this.buAndBgList[i].bu === val) {
              row.buId = this.buAndBgList[i].id;
              row.bg = this.buAndBgList[i].bg;
              break;
            }
          }
        }
      },
      getBu1() {
      selectBu().then(res => {
        this.buList1 = res.data;
      });
      },
      getBg1() {
        selectBg().then(res => {
          this.bgList1 = res.data;
        });
    },
      getBuAndBg() {
        selectBuAndBg().then(res => {
          this.buAndBgList = res.data;
        });
      },
       changeBg1(val) {
         if(val =='' || val==null){
            this.getBu1();
            return
        }
        // 联动bu
        listbgAndbu({ bu: '', bg: val }).then(res => {
          this.buList1 = res.data;
        });
      },
       changeBu1(val) {
         if(val =='' || val==null){
            this.getBg1();
            return
        }
        // 联动bg
        listbgAndbu({ bu: val, bg: '' }).then(res => {
          this.bgList1 = res.data;
        });
      },
      getBu() {
        selectBu().then(res => {
          this.buList = res.data;
          const bu = []
          if(res.data){
            for (let i = 0; i < res.data.length; i++) {
                bu.push({
                  value: res.data[i],
                  label: res.data[i]
                })
              }
                    this.dataPermissionsList = [
                      {
                        value: 'ALL',
                        label: 'ALL'
              }, ...bu];
          }
        });
      },
      findBu() {
        selectBuAndBg().then(res => {
          this.buList = res.data;
        });
      },
      handlePreserve() {
         let myMap = new Map()
          for(const key in this.listMapAll.whetherEffective){
            myMap.set(this.listMapAll.whetherEffective[key],key);
          }
        const data = this.formatter.extend(this.list)
        data.forEach(row => {
          row.groupType = row.groupTypes.join(',')
          row.dataPermissions = row.dataPermissionss.join(',')
          if(null != row.status){
            if('0'=== row.status){
              row.status = '0'
            }else if('1'=== row.status){
              row.status = '1'
            }else{
              row.status = myMap.get(row.status)
            }
          }  else {
            row.status = '';
          }
        })
        console.info(data)
        saveUserInfo(data).then(res => {
          this.$notify({
            title: res.status === 200 ? this.$t('tips.success') : this.$t('tips.fail'),
            message: res.status === 200 ? this.$t('tips.success') : this.$t('tips.fail'),
            type: res.status === 200 ? 'success' : 'warning'
          });
          this.getList();
          this.dictDialogVisible = false;
        });
      },
      getQuery() {
        const searchPeopleManager = window.sessionStorage.getItem('searchPeopleManager');
        if (searchPeopleManager) {
          this.listQuery = JSON.parse(searchPeopleManager);
        }
      },
      getList() {
        this.listLoading = true;
        getUserInfoList(this.listQuery).then(response => {
          this.list = response.data.data.rows;
          if (this.list) {
            this.list.forEach((x, i) => {
              if (x.groupType) {
                this.$set(this.list[i], 'groupTypes', x.groupType.split(','))
              } else {
                this.$set(this.list[i], 'groupTypes', [])
              }

              if (x.dataPermissions) {
                this.$set(this.list[i], 'dataPermissionss', x.dataPermissions.split(','))
              } else {
                this.$set(this.list[i], 'dataPermissionss', [])
              }

              x.status = this.strAll.status[x.status];
            });
            this.total = response.data.data.total;
          }

          this.listLoading = false;
        });
      },
      handleFilter() {
        this.getList();
      },
      // 排序
      sortDate(column) {
        console.log('column', column);
        // this.formatter.sortByKey(this.list, column.prop, column.order)
        if (column.order === 'ascending') {
          this.listQuery.order = 'asc';
        } else if (column.order === 'descending') {
          this.listQuery.order = 'desc';
        }
        this.listQuery.orderBy = column.prop;
        this.getList()
      },
      reset() {
        this.listQuery = {
          page: 1,
          limit: 10,
          username: '',
          name: '',
          bu: [],
          groupType: [],
          costCenter: [],
          status: ''
        };
        this.getList();
      },
      handleSizeChange(val) {
        this.listQuery.limit = val;
        this.getList();
      },
      handleCurrentChange(val) {
        this.listQuery.page = val;
        this.getList();
      },
      resetTemp() {
        this.form = {
          username: undefined,
          name: undefined,
          sex: '男',
          password: undefined,
          description: undefined,
          departId: undefined,
          departName: undefined,
          email: undefined
        };
      }
    },
    beforeDestroy() {
      window.sessionStorage.setItem('searchPeopleManager', JSON.stringify(this.listQuery));
    }
  };
</script>
<style scoped lang="scss">
  /deep/ .el-select{
    display: flex;
    justify-content: center;
  }
  .btn {
    margin-left: 12px;
  }
  // .box{
  //   padding: 0 15px !important;
  //   height: 36px;
  //   line-height: 36px;
  //   text-align: center;
  //   border-radius: 4px;
  //   color: #333;
  // }
  // .box:empty:before{
  //   content: attr(placeholder);
  //   color: #c0c4cc;
  //   font-size: 14px;
  // }
  .box{
    /* border: 1px solid #d9d9d9; */
    padding: 0 15px !important;
    height: 36px;
    line-height: 36px;
    text-align: left;
    border-radius: 4px;
    color: #333;
    cursor:text;
    font-size: 12px;
  }
  .box:empty:before{
    content: attr(placeholder);
    color: #c0c4cc;
    font-size: 14px;
  }


  .box1{
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 4px;
    color: #333;
    cursor:text;
    padding:0 15px;
  }
  .box1:empty:before{
    content: attr(placeholder);
    color: #c0c4cc;
    font-size: 12px;
  }
</style>
